Repository navigation
BUG: Wrap types that Strain and IsotropicWavelets wrappings refer to - #7230
Merged
hjmjohnson merged 2 commits intoNov 25, 2026
Merged
hjmjohnson merged 2 commits into
hjmjohnson merged 2 commits into
Conversation
dzenanz
marked this pull request as ready for review
November 23, 2026 16:50
Contributor
[Medium impact] The changes affect Python wrapper types in two bounded ITK modules. Fix the Findings
|
StrainImageFilter::VectorGradientFilterType is an ImageToImageFilter from a Vector image to a CovariantVector image. ITKCommon wraps that pair only for enabled vector and covariant vector types, so for double Strain types igenerator reported it as not wrapped. Float Strain types are now wrapped only when float Vector and CovariantVector images are. Without them, the gradient filter types were reported as not wrapped, or the input image type was undefined.
igenerator reported types that wrapped IsotropicWavelets methods use but that nothing wraps: - Matrix<std::complex> methods take complex Vector, Point and CovariantVector, which do not compile for complex values. No IsotropicWavelets class uses a complex Matrix, so it is not wrapped. - VariableSizeMatrix<std::complex> uses Array<std::complex>, now wrapped along with vnl_vector<std::complex<double>> when complex double wrapping is off. - RieszStructureTensorImageFilter::GetGaussianSource() returns a GaussianImageSource of double images, now wrapped with its superclasses when double wrapping is off. Python expression tests cover GetGaussianSource() and complex Array.
dzenanz
force-pushed
the
wrap-strain-isotropicwavelets-types
branch
from
November 23, 2026 21:32
7b0a2dd to
7c49a35
Compare
hjmjohnson
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
igenerator reported
ITK type not wrappedfor Strain and IsotropicWavelets in wheel and default builds. Both now wrap the types their wrapped methods use; complexitk::Matrixis no longer wrapped, and floatStrainImageFilteris wrapped only when floatVectorandCovariantVectorimages are.Warnings and fixes
ImageToImageFilter<Image<Vector<double,d>,d>, Image<CovariantVector<double,d>,d>>(VectorGradientFilterType)ImageToImageFilterfrom float images toImage<CovariantVector<float,d>,d>(GradientFilterType,VectorGradientFilterType)ITK_WRAP_covariant_vector_float=OFFVectorandCovariantVectorimages are wrappedVector,Point,CovariantVectorused byMatrix<std::complex<T>,d,d>MatrixArray<std::complex<T>>used by complexVariableSizeMatrixArrayfor the same types, plusvnl_vector<std::complex<double>>when complex double wrapping is offGaussianImageSource<Image<double,d>>returned byRieszStructureTensorImageFilter::GetGaussianSource()VectorandPointcannot be instantiated:Normalize,GetNormand the barycentric combinations do not compile forstd::complex. No IsotropicWavelets class uses a complexMatrix, soitk.Matrix[itk.complex[...], 2|3, 2|3]is removed from Python rather than left with unusable methods.-Werror, soArray<std::complex<double>>needs itsvnl_vectorbase wrapped too; ITKCommon wraps complexvnl_vectoronly forWRAP_ITK_COMPLEX_REAL, whileVariableSizeMatrixalways includesCDforRieszRotationMatrix(3cf52eb).VectorandCovariantVectorimages are always wrapped, float ones only when enabled. WithITK_WRAP_vector_float=OFF, float Strain referred to undefined image types and generated invalid C++; withITK_WRAP_covariant_vector_float=OFF, its gradient filter types were not wrapped. FloatStrainImageFilteris now absent from Python in those configurations; double is always available.Testing
Windows, CMake 4.5.1, Ninja, MSVC 14.44. Minimal builds with
ITK_WRAP_PYTHON=ON:ITK_WRAP_IMAGE_DIMS=2;3, no double) and with the wheel's types (double, complex double, dims2;3;4): noITK type not wrappedwarning in either.ctest -R "Python|Strain|Wavelet|Riesz|Path": 214 of 215 and 219 of 220 pass;PythonLazyImportTimealso fails with the 6.0b3 wheels.itkRieszStructureTensorImageFilterGaussianSourcePythonTestchecks thatGetGaussianSource()returns a wrappedGaussianImageSource[itk.Image[itk.D, 2]], anditkArrayComplexPythonTestconstructsitk.Array[itk.complex[itk.D]].itk.Array[itk.complex[itk.F]]also instantiate, and importing withitkConfig.LazyLoading = Falseloads all modules without duplicate-wrapping warnings.ITK_WRAP_covariant_vector_float=OFF: before the Strain fix, the generated CastXML input helditk::ImageToImageFilter< itk::Image< itk::Vector< float,2 >,2 >, >; now the full build has noITK type not wrappedwarning and all 26 Strain tests pass.ITK_WRAP_vector_float=OFF, configure only: only double Strain templates are generated.AI assistance
Claude Code (Opus 5.5) attributed the warnings in a wheel build log to their modules, checked which types core wrapping provides, compiled a complex
Vector/Pointinstantiation test, wrote the changes and tests, and ran the builds above.🤖 Generated with Claude Code